package sipoc.ws;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import sipoc.gateway.HbGateway;
import sipoc.model.HbRequest;
import sipoc.model.HbResponse;

@RestController
public class HbWebService {

	private static final Logger LOGGER = LoggerFactory
			.getLogger(HbWebService.class);

	@Autowired
	private HbGateway hbGateway;

	@RequestMapping(value = "/hb")
	public HbResponse performHb(@RequestBody HbRequest request) {
		LOGGER.info("hb request received: {}", request);
		return hbGateway.doHb(request);
	}

}
